* {
    margin: 0;
    padding: 0;
}
html,
body {
    width: 100%;
    height: 100%;
}

#chessboard {
    width: 15 * 50 + px;
    height: 15 * 50 + px;
    padding: 15px;
    position: relative;

    #scaleplateX,
    #scaleplateY {
        position: absolute;
        top: 0;
        left: 0;
        box-sizing: border-box;
        .label {
            width: 50px;
            height: 50px;
            line-height: 50px;
            text-align: center;
            float: left;
        }
    }

    #scaleplateX {
        height: 35px;
        right: 0;
        padding: 0 15px;
        .label {
            height: 40px;
            line-height: 40px;
        }
    }

    #scaleplateY {
        width: 35px;
        bottom: 0;
        padding: 15px 0;
        .label {
            width: 40px;
            text-align: center;
        }
    }

    #chessbox {
        
        &:after,
        &:before {
            display: table;
            content: "";
        }

        &:after {
            clear: both;
        }

        .grid {
            width: 50px;
            height: 50px;
            box-sizing: border-box;
            
            float: left;
            cursor: pointer;
            position: relative;
    
            &:after,
            &:before {
                position: absolute;
                background: #000;
                content: "";
            }
    
            &:after {
                width: 2px;
                height: 100%;
                left: 50%;
                margin-left: -1px;
            }
    
            &:before {
                height: 2px;
                width: 100%;
                top: 50%;
                margin-top: -1px;
            }

            &[data-y="1"] {
                &:after {
                    top: 50%;
                }
            }
            
            &[data-y="15"] {
                &:after {
                    bottom: 50%;
                }
            }

            &[data-x="A"] {
                &:before {
                    left: 50%;
                }
            }

            &[data-x="O"] {
                &:before {
                    right: 50%;
                }
            }

            .piece {
                position: absolute;
                z-index: 2;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                padding: 3px;
                box-sizing: border-box;

                .piece_content{
                    position: absolute;
                    z-index: 2;
                    top: 0;
                    left: 0;
                    right: 0;
                    bottom: 0;
                    text-align: center;
                    font-size: 14px;
                    line-height: 50px;
                }
                
                &:after {
                    content: '';
                    top: 50%;
                    left: 50%;
                    position: absolute;
                    border-radius: 50%;
                    box-sizing: border-box;
                }
            }

            @mixin star () {
                &:after {
                    margin-top: -7px;
                    margin-left: -7px;
                    width: 14px;
                    height: 14px;
                    background: #000;
                }
            }

            @mixin white-stones () {
                &:after {
                    margin-top: -23px!important;
                    margin-left: -23px!important;
                    width: 46px!important;
                    height: 46px!important;
                    background: #fff!important;
                    border: 1px solid #000!important;
                }
            }

            @mixin black-stones () {
                &:after {
                    margin-top: -23px!important;
                    margin-left: -23px!important;
                    width: 46px!important;
                    height: 46px!important;
                    background: #000!important;
                    border: 1px solid #000!important;
                }
            }

            &[data-x="D"][data-y="4"],
            &[data-x="D"][data-y="12"],
            &[data-x="L"][data-y="4"],
            &[data-x="L"][data-y="12"],
            &[data-x="H"][data-y="8"] {
                .piece {
                    @include star();
                }
            }

            &[data-status="white"]{
                .piece {
                    .piece_content{
                        color: #000;
                    }
                    @include white-stones();
                }
            }

            &[data-status="black"]{
                .piece {
                    .piece_content{
                        color: #fff;
                    }
                    @include black-stones();
                }
            }
        }
    }
}